Advertisement
Guest User

Untitled

a guest
Mar 6th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. int main()
  2. {
  3.  
  4. DDRD |= (1<<PD0)|(1<<PD1);
  5. DDRB = 1;
  6. DDRC |= (1<<PC4)|(1<<PC5);
  7.  
  8. InitUSART();
  9. i2c_init();
  10. sei();
  11.  
  12. unsigned char line[16];
  13. unsigned char index;
  14. index=0;
  15.  
  16. while(1)
  17.   {
  18.    while (serial_available())
  19.      {
  20.         line[index++]= serial_read();
  21.         USART_Send(line[index]);
  22.      }
  23.      index=0;
  24. _delay_ms(5000);
  25.   }
  26.  
  27. return 0;
  28. }
  29.  
  30.  
  31. ISR(USART_RXC_vect)
  32. {
  33.     rxb[rxc]=UDR;
  34.     rxc+=1;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement